# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from documents.views import DocList, DocstbyCategory, DocsCreate, DocsUpdate, DocsCatUpdate, DocsCatCreate, DocsCatDeleteView, DocsDeleteView

urlpatterns = patterns('',
    url(r'^$', login_required(DocList.as_view()), name="doc_list"),
    url(r'^create/$', login_required(DocsCreate.as_view()), name="docs_create"),
    url(r'^update/(?P<pk>[-\w]+)/$', login_required(DocsUpdate.as_view()), name="docs_update"),
    url(r'^delete/(?P<pk>[-\w]+)/$', login_required(DocsDeleteView.as_view()), name="docs_delete"),
    url(r'^createcat/$', login_required(DocsCatCreate.as_view()), name="docs_cat_create"),
    url(r'^updatecat/(?P<pk>[-\w]+)/$', login_required(DocsCatUpdate.as_view()), name="docs_cat_update"),
    url(r'^deletecat/(?P<pk>[-\w]+)/$', login_required(DocsCatDeleteView.as_view()), name="docs_cat_delete"),
    url(r'^(?P<pk>[-\w]+)/$', login_required(DocstbyCategory.as_view()), name="docs_detail"),
)
  